package seckill

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type SeckillActivityRouter struct {}

// InitSeckillActivityRouter 初始化 秒杀活动 路由信息
func (s *SeckillActivityRouter) InitSeckillActivityRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	seckillActivityRouter := Router.Group("seckillActivity").Use(middleware.OperationRecord())
	seckillActivityRouterWithoutRecord := Router.Group("seckillActivity")
	seckillActivityRouterWithoutAuth := PublicRouter.Group("seckillActivity")
	{
		seckillActivityRouter.POST("createSeckillActivity", seckillActivityApi.CreateSeckillActivity)   // 新建秒杀活动
		seckillActivityRouter.DELETE("deleteSeckillActivity", seckillActivityApi.DeleteSeckillActivity) // 删除秒杀活动
		seckillActivityRouter.DELETE("deleteSeckillActivityByIds", seckillActivityApi.DeleteSeckillActivityByIds) // 批量删除秒杀活动
		seckillActivityRouter.PUT("updateSeckillActivity", seckillActivityApi.UpdateSeckillActivity)    // 更新秒杀活动
	}
	{
		seckillActivityRouterWithoutRecord.GET("findSeckillActivity", seckillActivityApi.FindSeckillActivity)        // 根据ID获取秒杀活动
		seckillActivityRouterWithoutRecord.GET("getSeckillActivityList", seckillActivityApi.GetSeckillActivityList)  // 获取秒杀活动列表
	}
	{
	    seckillActivityRouterWithoutAuth.GET("getSeckillActivityPublic", seckillActivityApi.GetSeckillActivityPublic)  // 秒杀活动开放接口
	}
}
